{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2.2 Python 使用入门"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.2.1 基本命令"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello World!\n"
     ]
    }
   ],
   "source": [
    "print (\"Hello World!\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello World!\n"
     ]
    }
   ],
   "source": [
    "x = 1\n",
    "if x == 1:\n",
    "    print (\"Hello World!\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello World!\n"
     ]
    }
   ],
   "source": [
    "# 在前面加上#，代表注释\n",
    "print (\"Hello World!\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.2.2 数据类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Python Web Scrappy by Santos\n"
     ]
    }
   ],
   "source": [
    "string1 = 'Python Web Scrappy'\n",
    "string2 = \"by Santos\"\n",
    "string3 = string1 + \" \" + string2\n",
    "print (string3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7\n"
     ]
    }
   ],
   "source": [
    "int1 = 7\n",
    "float1 = 7.5\n",
    "trans_int = int(float1)\n",
    "print (trans_int)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "list1 = ['Python', 'Web', 'Scrappy']\n",
    "list2 = [1, 2, 3, 4, 5]\n",
    "list3 = [\"a\", 2, \"c\", 4]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "list1[0]:  Python\n",
      "list2[1:3]:  [2, 3]\n"
     ]
    }
   ],
   "source": [
    "print (\"list1[0]: \" , list1[0])\n",
    "print (\"list2[1:3]: \" , list2[1:3])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['Python', 'new', 'Scrappy']\n"
     ]
    }
   ],
   "source": [
    "list1[1] = \"new\"\n",
    "print (list1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Alex\n",
      "{'Name': 'Alex', 'Age': 7, 'Class': 'First'}\n"
     ]
    }
   ],
   "source": [
    "namebook = {\"Name\": \"Alex\", \"Age\": 7, \"Class\": \"First\"}\n",
    "print (namebook[\"Name\"]) #可以把相应的键值放入方括号，提取值\n",
    "print (namebook) #也可以直接输出整个字典"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Name Alex\n",
      "Age 7\n",
      "Class First\n"
     ]
    }
   ],
   "source": [
    "#循环提取整个dictionary的key和value\n",
    "for key, value in namebook.items():\n",
    "    print (key, value)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.2.3 条件语句和循环语句\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You are studying python.\n"
     ]
    }
   ],
   "source": [
    "book = \"python\"  #定义字符串book\n",
    "if book == \"python\":   #判断变量是否为'python'\n",
    "    print (\"You are studying python.\")  #条件成立时输出\n",
    "else:\n",
    "    print (\"Wrong.\") #条件不成立时输出"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You are studying java.\n"
     ]
    }
   ],
   "source": [
    "book = \"java\"  #定义字符串book\n",
    "if book == \"python\":   #判断变量是否为'python'\n",
    "    print (\"You are studying python.\")  #条件成立时输出\n",
    "elif book == \"java\":  #判断变量是否为'java '\n",
    "    print (\"You are studying java.\") #条件成立时输出\n",
    "else:\n",
    "    print (\"Wrong.\") #条件不成立时输出"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Beijing\n",
      "Shanghai\n",
      "Guangzhou\n"
     ]
    }
   ],
   "source": [
    "citylist = [\"Beijing\", \"Shanghai\", \"Guangzhou\"]\n",
    "for eachcity in citylist:\n",
    "    print (eachcity)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "1\n",
      "2\n"
     ]
    }
   ],
   "source": [
    "count = 0\n",
    "while count < 3:\n",
    "    print (count) #打印出 0,1,2\n",
    "    count += 1 #与 count = count + 1 一样"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.2.4 函数(Functions)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n"
     ]
    }
   ],
   "source": [
    "#定义函数\n",
    "def calulus (x):\n",
    "    y = x + 1\n",
    "    return y\n",
    "\n",
    "#调用函数\n",
    "result = calulus(2)\n",
    "print (result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "apple banana\n"
     ]
    }
   ],
   "source": [
    "#定义函数\n",
    "def fruit_function (fruit1, fruit2):\n",
    "    fruits = fruit1 + \" \" + fruit2\n",
    "    return fruits\n",
    "\n",
    "#调用函数\n",
    "result = fruit_function(\"apple\", \"banana\")\n",
    "print (result)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.2.5  面向对象编程\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2017-07-11T09:31:51.290201Z",
     "start_time": "2017-07-11T09:31:51.274622Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "santos\n",
      "18\n"
     ]
    }
   ],
   "source": [
    "class Person:   # 创建类\n",
    "    def __init__(self, name, age): #__init__()方法称为类的构造方法\n",
    "        self.name = name\n",
    "        self.age = age\n",
    " \n",
    "    def detail(self): #通过self调用被封装的内容\n",
    "        print (self.name)\n",
    "        print (self.age)\n",
    "\n",
    "obj1 = Person('santos', 18)\n",
    "obj1.detail()  # Python将obj1传给self参数，即：obj1.detail(obj1)，此时内部self＝obj1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "santos\n",
      "18\n"
     ]
    }
   ],
   "source": [
    "def detail(name,age): \n",
    "    print (name)\n",
    "    print (age)\n",
    "obj1 = detail('santos', 18)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2017-07-11T09:32:29.618086Z",
     "start_time": "2017-07-11T09:32:29.612355Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "class Person:   # 创建类\n",
    "    def __init__(self, name, age): #__init__()方法称为类的构造方法\n",
    "        self.name = name\n",
    "        self.age = age\n",
    "        \n",
    "obj1 = Person('santos', 18) #将\"santos\"和 18 分别封装到 obj1 及 self的 name和age属性"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 封装"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "santos\n",
      "18\n"
     ]
    }
   ],
   "source": [
    "class Person:   # 创建类\n",
    "    def __init__(self, name, age): #__init__()方法称为类的构造方法\n",
    "        self.name = name\n",
    "        self.age = age\n",
    "        \n",
    "obj1 = Person('santos', 18) #将\"santos\"和 18 分别封装到 obj1 及 self的 name和age属性\n",
    "print (obj1.name)    # 直接调用obj1对象的name属性\n",
    "print (obj1.age)     # 直接调用obj1对象的age属性"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2017-07-11T09:34:20.495707Z",
     "start_time": "2017-07-11T09:34:20.485891Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "santos\n",
      "18\n"
     ]
    }
   ],
   "source": [
    "class Person:   # 创建类\n",
    "    def __init__(self, name, age): #__init__()方法称为类的构造方法\n",
    "        self.name = name\n",
    "        self.age = age\n",
    " \n",
    "    def detail(self): #通过self调用被封装的内容\n",
    "        print (self.name)\n",
    "        print (self.age)\n",
    "\n",
    "obj1 = Person('santos', 18)\n",
    "obj1.detail()  # Python将obj1传给self参数，即：obj1.detail(obj1)，此时内部self＝obj1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 继承"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2017-07-11T09:34:44.252777Z",
     "start_time": "2017-07-11T09:34:44.243993Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "class 猫： \n",
    "    def 喵喵叫(self):\n",
    "        print ('喵喵叫')\n",
    "    def 吃(self):\n",
    "        # do something\n",
    "    def 喝(self):\n",
    "        # do something \n",
    "    def 拉(self):\n",
    "        # do something \n",
    "    def 撒(self):\n",
    "        # do something\n",
    "\n",
    "class 狗：\n",
    "    def 汪汪叫(self):\n",
    "        print ('汪汪叫')\n",
    "    def 吃(self):\n",
    "        # do something\n",
    "    def 喝(self):\n",
    "        # do something \n",
    "    def 拉(self):\n",
    "        # do something \n",
    "    def 撒(self):\n",
    "        # do something"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "小白家的小黑猫 吃 \n",
      "喵喵叫\n",
      "胖子家的小瘦狗 吃 \n"
     ]
    }
   ],
   "source": [
    "class Animal:\n",
    "    def eat(self):\n",
    "        print (\"%s 吃 \" %self.name)\n",
    "    def drink(self):\n",
    "        print (\"%s 喝 \" %self.name) \n",
    "    def shit(self):\n",
    "        print (\"%s 拉 \" %self.name) \n",
    "    def pee(self):\n",
    "        print (\"%s 撒 \" %self.name)\n",
    "class Cat(Animal): \n",
    "    def __init__(self, name):\n",
    "        self.name = name \n",
    "    def cry(self):\n",
    "        print ('喵喵叫')\n",
    "class Dog(Animal): \n",
    "    def __init__(self, name):\n",
    "        self.name = name\n",
    "    def cry(self):\n",
    "        print ('汪汪叫')\n",
    "        \n",
    "c1 = Cat('小白家的小黑猫')\n",
    "c1.eat()\n",
    "c1.cry()\n",
    " \n",
    "d1 = Dog('胖子家的小瘦狗')\n",
    "d1.eat()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# 2.3 编写你的第一个简单爬虫"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.3.1 第一步：获取页面\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<!DOCTYPE html>\r\n",
      "<html lang=\"zh-CN\">\r\n",
      "<head>\r\n",
      "<meta charset=\"UTF-8\">\r\n",
      "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n",
      "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1\">\r\n",
      "<title>大数据分析@唐松</title>\r\n",
      "<meta name=\"description\" content=\"唐松的个人博客，分享大数据分析和 Python 网络爬虫的思考。\" />\r\n",
      "<meta name=\"keywords\" content=\"唐松, Santos, 博客\" />\r\n",
      "<link rel=\"shortcut icon\" href=\"http://www.santostang.com/wp-content/themes/SongStyle-Two/images/favicon.ico\" type=\"image/x-icon\" />\r\n",
      "<link rel=\"stylesheet\" href=\"http://www.santostang.com/wp-content/themes/SongStyle-Two/css/bootstrap.min.css\">\r\n",
      "<link rel=\"stylesheet\" href=\"http://www.santostang.com/wp-content/themes/SongStyle-Two/css/font-awesome.min.css\">\r\n",
      "<script type=\"text/javascript\" src=\"http://www.santostang.com/wp-content/themes/SongStyle-Two/js/jquery.min.js\"></script>\r\n",
      "<script type=\"text/javascript\" src=\"http://www.santostang.com/wp-content/themes/SongStyle-Two/js/bootstrap.min.js\"></script>\r\n",
      "<link rel=\"stylesheet\" href=\"http://www.santostang.com/wp-content/themes/SongStyle-Two/style.css\">\r\n",
      "<link rel=\"pingback\" href=\"http://www.santostang.com/xmlrpc.php\" />\r\n",
      "<link rel='dns-prefetch' href='//s.w.org' />\n",
      "<link rel='stylesheet' id='crayon-css'  href='http://www.santostang.com/wp-content/plugins/crayon-syntax-highlighter/css/min/crayon.min.css?ver=_2.7.2_beta' type='text/css' media='all' />\n",
      "<link rel='stylesheet' id='crayon-theme-classic-css'  href='http://www.santostang.com/wp-content/plugins/crayon-syntax-highlighter/themes/classic/classic.css?ver=_2.7.2_beta' type='text/css' media='all' />\n",
      "<link rel='stylesheet' id='crayon-font-monaco-css'  href='http://www.santostang.com/wp-content/plugins/crayon-syntax-highlighter/fonts/monaco.css?ver=_2.7.2_beta' type='text/css' media='all' />\n",
      "<link rel='https://api.w.org/' href='http://www.santostang.com/wp-json/' />\n",
      "<script type=\"text/javascript\" src=\"http://www.santostang.com/wp-content/plugins/si-captcha-for-wordpress/captcha/si_captcha.js?ver=1495951703\"></script>\n",
      "<!-- begin SI CAPTCHA Anti-Spam - login/register form style -->\r\n",
      "<style type=\"text/css\">\r\n",
      ".si_captcha_small { width:175px; height:45px; padding-top:10px; padding-bottom:10px; }\n",
      ".si_captcha_large { width:250px; height:60px; padding-top:10px; padding-bottom:10px; }\n",
      "img#si_image_com { border-style:none; margin:0; padding-right:5px; float:left; }\n",
      "img#si_image_reg { border-style:none; margin:0; padding-right:5px; float:left; }\n",
      "img#si_image_log { border-style:none; margin:0; padding-right:5px; float:left; }\n",
      "img#si_image_side_login { border-style:none; margin:0; padding-right:5px; float:left; }\n",
      "img#si_image_checkout { border-style:none; margin:0; padding-right:5px; float:left; }\n",
      "img#si_image_jetpack { border-style:none; margin:0; padding-right:5px; float:left; }\n",
      "img#si_image_bbpress_topic { border-style:none; margin:0; padding-right:5px; float:left; }\n",
      ".si_captcha_refresh { border-style:none; margin:0; vertical-align:bottom; }\n",
      "div#si_captcha_input { display:block; padding-top:15px; padding-bottom:5px; }\n",
      "label#si_captcha_code_label { margin:0; }\n",
      "input#si_captcha_code_input { width:65px; }\n",
      "p#si_captcha_code { clear: left; padding-top:10px; }\n",
      ".si-captcha-jetpack-error { color:#DC3232; }\n",
      "</style>\r\n",
      "<!-- end SI CAPTCHA Anti-Spam - login/register form style -->\r\n",
      "</head>\r\n",
      "\r\n",
      "<body>\r\n",
      "<header id=\"header\">\r\n",
      "  <div class=\"avatar\"><img src=\"http://www.santostang.com/wp-content/themes/SongStyle-Two/images/avatar.jpg\" alt=\"大数据@唐松Santos\" class=\"img-circle\" width=\"50%\"></div>\r\n",
      "  <h3 id=\"name\">大数据@唐松Santos</h3>\r\n",
      "  <div class=\"sns\">\r\n",
      "    <a href=\"http://www.santostang.com/feed/\" target=\"_blank\" rel=\"nofollow\" title=\"RSS\"><i class=\"fa fa-rss\" aria-hidden=\"true\"></i></a>\r\n",
      "        <a href=\"http://weibo.com/santostang\" target=\"_blank\" rel=\"nofollow\" title=\"Weibo\"><i class=\"fa fa-weibo\" aria-hidden=\"true\"></i></a>\r\n",
      "                <a href=\"https://www.linkedin.com/in/santostang\" target=\"_blank\" rel=\"nofollow\" title=\"Linkedin\"><i class=\"fa fa-linkedin\" aria-hidden=\"true\"></i></a>\r\n",
      "                <a href=\"mailto:tangsongsky@gmail.com\" target=\"_blank\" rel=\"nofollow\" title=\"envelope\"><i class=\"fa fa-envelope\" aria-hidden=\"true\"></i></i></a>\r\n",
      "          </div>\r\n",
      "  <div class=\"nav\">\r\n",
      "   <ul><li class=\"current-menu-item\"><a href=\"http://www.santostang.com/\">首页</a></li>\n",
      "<li><a href=\"http://www.santostang.com/about-me/\">关于我</a></li>\n",
      "<li><a href=\"http://www.santostang.com/post-search/\">文章搜索</a></li>\n",
      "<li><a href=\"http://www.santostang.com/wp-login.php\">登录</a></li>\n",
      "</ul>  </div>\r\n",
      "</header>\n",
      "<div id=\"main\">\n",
      "  <div class=\"row box\">\n",
      "    <div class=\"col-md-8\">\n",
      "                  <article class=\"article-list-1 clearfix\">\n",
      "        <header class=\"clearfix\">\n",
      "          <h1 class=\"post-title\"><a href=\"http://www.santostang.com/2017/03/08/hello-python/\">Hello Python!</a></h1>\n",
      "          <div class=\"post-meta\">\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-calendar\"></i> 03月08日</span>\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-folder-open-o\"></i> <a href=\"http://www.santostang.com/category/big-data-marketing/\" rel=\"category tag\">大数据营销</a></span>\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-commenting-o\"></i> <a href=\"http://www.santostang.com/2017/03/08/hello-python/#respond\">没有评论</a></span>\n",
      "            <span class=\"meta-span hidden-xs\"><i class=\"fa fa-tags\" aria-hidden=\"true\"></i> </span>\n",
      "          </div>\n",
      "        </header>\n",
      "        <div class=\"post-content clearfix\">\n",
      "          <p>This is an article for testing. I use it to show the example in my book Web Scrappy by Python.\n",
      "</p>\n",
      "        </div>\n",
      "      </article>\n",
      "                        <article class=\"article-list-1 clearfix\">\n",
      "        <header class=\"clearfix\">\n",
      "          <h1 class=\"post-title\"><a href=\"http://www.santostang.com/2017/03/07/echarts%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b02-%e5%8d%95%e9%a1%b5%e9%9d%a2%e5%a4%9a%e5%bc%a0%e5%9b%be%e8%a1%a8/\">echarts学习笔记(2) &#8212; 同一页面多图表</a></h1>\n",
      "          <div class=\"post-meta\">\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-calendar\"></i> 03月07日</span>\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-folder-open-o\"></i> <a href=\"http://www.santostang.com/category/big-data-marketing/\" rel=\"category tag\">大数据营销</a></span>\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-commenting-o\"></i> <a href=\"http://www.santostang.com/2017/03/07/echarts%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b02-%e5%8d%95%e9%a1%b5%e9%9d%a2%e5%a4%9a%e5%bc%a0%e5%9b%be%e8%a1%a8/#respond\">没有评论</a></span>\n",
      "            <span class=\"meta-span hidden-xs\"><i class=\"fa fa-tags\" aria-hidden=\"true\"></i> </span>\n",
      "          </div>\n",
      "        </header>\n",
      "        <div class=\"post-content clearfix\">\n",
      "          <p>本文首发于 CSDN，当年，也就是2014年，我还是在大四的最后一个暑假，在 EMC 做实习，用 echarts做一个可视化的工具。\n",
      "\n",
      "在一个页面只是一个图表很简单，如果要在一个页面中添加多张图的话，怎么办呢？\n",
      "\n",
      "      \n",
      "\n",
      "...</p>\n",
      "        </div>\n",
      "      </article>\n",
      "                        <article class=\"article-list-1 clearfix\">\n",
      "        <header class=\"clearfix\">\n",
      "          <h1 class=\"post-title\"><a href=\"http://www.santostang.com/2017/03/07/echarts%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b01-%e4%bd%bf%e7%94%a8%e6%a8%a1%e5%9d%97%e5%8c%96%e5%8d%95%e6%96%87%e4%bb%b6%e5%bc%95%e5%85%a5/\">echarts学习笔记(1) &#8212; 模块化单文件引入</a></h1>\n",
      "          <div class=\"post-meta\">\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-calendar\"></i> 03月07日</span>\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-folder-open-o\"></i> <a href=\"http://www.santostang.com/category/%e6%95%b0%e6%8d%ae%e5%8f%af%e8%a7%86%e5%8c%96/\" rel=\"category tag\">数据可视化</a></span>\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-commenting-o\"></i> <a href=\"http://www.santostang.com/2017/03/07/echarts%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b01-%e4%bd%bf%e7%94%a8%e6%a8%a1%e5%9d%97%e5%8c%96%e5%8d%95%e6%96%87%e4%bb%b6%e5%bc%95%e5%85%a5/#respond\">没有评论</a></span>\n",
      "            <span class=\"meta-span hidden-xs\"><i class=\"fa fa-tags\" aria-hidden=\"true\"></i> <a href=\"http://www.santostang.com/tag/echarts/\" rel=\"tag\">Echarts</a>,<a href=\"http://www.santostang.com/tag/%e5%a4%a7%e6%95%b0%e6%8d%ae/\" rel=\"tag\">大数据</a>,<a href=\"http://www.santostang.com/tag/%e6%95%b0%e6%8d%ae%e5%8f%af%e8%a7%86%e5%8c%96/\" rel=\"tag\">数据可视化</a></span>\n",
      "          </div>\n",
      "        </header>\n",
      "        <div class=\"post-content clearfix\">\n",
      "          <p>本文首发于 CSDN，地址为：echarts学习笔记(1)。当年，也就是2014年，我还是在大四的最后一个暑假，在 EMC 做实习，用 echarts做一个可视化的工具。\n",
      "\n",
      "因为最近需要用到echarts来做 BI 商业智能工具, 而echarts相...</p>\n",
      "        </div>\n",
      "      </article>\n",
      "                        <article class=\"article-list-1 clearfix\">\n",
      "        <header class=\"clearfix\">\n",
      "          <h1 class=\"post-title\"><a href=\"http://www.santostang.com/2017/03/06/%e3%80%90%e7%88%ac%e8%99%ab%e4%ba%8c%e3%80%91%e7%88%ac%e8%99%ab%e7%9a%84%e6%a1%86%e6%9e%b6%e5%92%8c%e5%9f%ba%e6%9c%ac%e8%ae%ae%e9%a2%98/\">【爬虫二】爬虫的框架和基本议题</a></h1>\n",
      "          <div class=\"post-meta\">\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-calendar\"></i> 03月06日</span>\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-folder-open-o\"></i> <a href=\"http://www.santostang.com/category/python_web_scrappy/\" rel=\"category tag\">python 网络爬虫</a></span>\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-commenting-o\"></i> <a href=\"http://www.santostang.com/2017/03/06/%e3%80%90%e7%88%ac%e8%99%ab%e4%ba%8c%e3%80%91%e7%88%ac%e8%99%ab%e7%9a%84%e6%a1%86%e6%9e%b6%e5%92%8c%e5%9f%ba%e6%9c%ac%e8%ae%ae%e9%a2%98/#respond\">没有评论</a></span>\n",
      "            <span class=\"meta-span hidden-xs\"><i class=\"fa fa-tags\" aria-hidden=\"true\"></i> <a href=\"http://www.santostang.com/tag/python/\" rel=\"tag\">python</a>,<a href=\"http://www.santostang.com/tag/%e5%a4%a7%e6%95%b0%e6%8d%ae/\" rel=\"tag\">大数据</a>,<a href=\"http://www.santostang.com/tag/%e7%bd%91%e7%bb%9c%e7%88%ac%e8%99%ab/\" rel=\"tag\">网络爬虫</a></span>\n",
      "          </div>\n",
      "        </header>\n",
      "        <div class=\"post-content clearfix\">\n",
      "          <p>本文首发于知乎专栏，@唐松。链接：知乎专栏：【爬虫二】爬虫的框架和基本议题\n",
      "\n",
      "爬虫的技术文章很少有从整体角度来说的，这次就从一个宏观的角度出发，希望通过这篇文章说清楚三个问题：\n",
      "\n",
      "\n",
      "爬虫的流程是怎样的？\n",
      "...</p>\n",
      "        </div>\n",
      "      </article>\n",
      "                        <article class=\"article-list-1 clearfix\">\n",
      "        <header class=\"clearfix\">\n",
      "          <h1 class=\"post-title\"><a href=\"http://www.santostang.com/2017/03/06/%e3%80%90%e7%88%ac%e8%99%ab%e4%b8%80%e3%80%91%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84%e7%88%ac%e8%99%ab%ef%bc%8c%e9%9b%b6%e5%9f%ba%e7%a1%80%e6%95%99%e5%ad%a6/\">【爬虫一】最简单的爬虫，零基础教学</a></h1>\n",
      "          <div class=\"post-meta\">\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-calendar\"></i> 03月06日</span>\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-folder-open-o\"></i> <a href=\"http://www.santostang.com/category/python_web_scrappy/\" rel=\"category tag\">python 网络爬虫</a></span>\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-commenting-o\"></i> <a href=\"http://www.santostang.com/2017/03/06/%e3%80%90%e7%88%ac%e8%99%ab%e4%b8%80%e3%80%91%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84%e7%88%ac%e8%99%ab%ef%bc%8c%e9%9b%b6%e5%9f%ba%e7%a1%80%e6%95%99%e5%ad%a6/#respond\">没有评论</a></span>\n",
      "            <span class=\"meta-span hidden-xs\"><i class=\"fa fa-tags\" aria-hidden=\"true\"></i> <a href=\"http://www.santostang.com/tag/python/\" rel=\"tag\">python</a>,<a href=\"http://www.santostang.com/tag/%e5%a4%a7%e6%95%b0%e6%8d%ae/\" rel=\"tag\">大数据</a>,<a href=\"http://www.santostang.com/tag/%e7%bd%91%e7%bb%9c%e7%88%ac%e8%99%ab/\" rel=\"tag\">网络爬虫</a></span>\n",
      "          </div>\n",
      "        </header>\n",
      "        <div class=\"post-content clearfix\">\n",
      "          <p>爬虫在大数据时代占据了重要的位置，在网上有大量的公开数据可以轻松获取。\n",
      "\n",
      "爬虫入门其实非常简单，就算你是编程小白，也可以轻松爬下一些网站。下面就以爬大众点评 在深圳市搜索潮汕牛肉的结果为例，教大家学会...</p>\n",
      "        </div>\n",
      "      </article>\n",
      "                        <article class=\"article-list-1 clearfix\">\n",
      "        <header class=\"clearfix\">\n",
      "          <h1 class=\"post-title\"><a href=\"http://www.santostang.com/2017/03/02/hello-world/\">Hello world!</a></h1>\n",
      "          <div class=\"post-meta\">\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-calendar\"></i> 03月02日</span>\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-folder-open-o\"></i> <a href=\"http://www.santostang.com/category/bigdata/\" rel=\"category tag\">大数据</a>,<a href=\"http://www.santostang.com/category/big-data-marketing/\" rel=\"category tag\">大数据营销</a></span>\n",
      "            <span class=\"meta-span\"><i class=\"fa fa-commenting-o\"></i> <a href=\"http://www.santostang.com/2017/03/02/hello-world/#respond\">没有评论</a></span>\n",
      "            <span class=\"meta-span hidden-xs\"><i class=\"fa fa-tags\" aria-hidden=\"true\"></i> </span>\n",
      "          </div>\n",
      "        </header>\n",
      "        <div class=\"post-content clearfix\">\n",
      "          <p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>\n",
      "        </div>\n",
      "      </article>\n",
      "                  <nav style=\"float:right\">\n",
      "              </nav>\n",
      "    </div>\n",
      "    <div class=\"col-md-4 hidden-xs hidden-sm\">\n",
      "      \n",
      "<aside class=\"widget clearfix\">\n",
      "  <form id=\"searchform\" action=\"http://www.santostang.com\">\n",
      "    <div class=\"input-group\">\n",
      "      <input type=\"search\" class=\"form-control\" placeholder=\"搜索…\" value=\"\" name=\"s\">\n",
      "      <span class=\"input-group-btn\">\n",
      "      <button class=\"btn btn-default\" type=\"submit\"><i class=\"fa fa-search\" aria-hidden=\"true\"></i></button>\n",
      "      </span> </div>\n",
      "  </form>\n",
      "</aside>\n",
      "<aside class=\"widget clearfix\">\n",
      "  <h4 class=\"widget-title\">文章分类</h4>\n",
      "  <div class=\"widget-cat\">\n",
      "    <ul>\n",
      "      \t<li class=\"cat-item cat-item-3\"><a href=\"http://www.santostang.com/category/python_web_scrappy/\" >python 网络爬虫</a> (2)\n",
      "</li>\n",
      "\t<li class=\"cat-item cat-item-2\"><a href=\"http://www.santostang.com/category/bigdata/\" >大数据</a> (1)\n",
      "</li>\n",
      "\t<li class=\"cat-item cat-item-1\"><a href=\"http://www.santostang.com/category/big-data-marketing/\" >大数据营销</a> (3)\n",
      "</li>\n",
      "\t<li class=\"cat-item cat-item-9\"><a href=\"http://www.santostang.com/category/%e6%95%b0%e6%8d%ae%e5%8f%af%e8%a7%86%e5%8c%96/\" >数据可视化</a> (1)\n",
      "</li>\n",
      "    </ul>\n",
      "  </div>\n",
      "</aside>\n",
      "<aside class=\"widget clearfix\">\n",
      "  <h4 class=\"widget-title\">热门文章</h4>\n",
      "  <ul class=\"widget-hot\">\n",
      "    \n",
      "<li><a href=\"http://www.santostang.com/2017/03/02/hello-world/\" target=\"_blank\" >Hello world!</a></li>\n",
      "<li><a href=\"http://www.santostang.com/2017/03/06/%e3%80%90%e7%88%ac%e8%99%ab%e4%b8%80%e3%80%91%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84%e7%88%ac%e8%99%ab%ef%bc%8c%e9%9b%b6%e5%9f%ba%e7%a1%80%e6%95%99%e5%ad%a6/\" target=\"_blank\" >【爬虫一】最简单的爬虫，零基础教学</a></li>\n",
      "<li><a href=\"http://www.santostang.com/2017/03/06/%e3%80%90%e7%88%ac%e8%99%ab%e4%ba%8c%e3%80%91%e7%88%ac%e8%99%ab%e7%9a%84%e6%a1%86%e6%9e%b6%e5%92%8c%e5%9f%ba%e6%9c%ac%e8%ae%ae%e9%a2%98/\" target=\"_blank\" >【爬虫二】爬虫的框架和基本议题</a></li>\n",
      "<li><a href=\"http://www.santostang.com/2017/03/07/echarts%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b01-%e4%bd%bf%e7%94%a8%e6%a8%a1%e5%9d%97%e5%8c%96%e5%8d%95%e6%96%87%e4%bb%b6%e5%bc%95%e5%85%a5/\" target=\"_blank\" >echarts学习笔记(1) -- 模块化单文件引入</a></li>\n",
      "<li><a href=\"http://www.santostang.com/2017/03/07/echarts%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b02-%e5%8d%95%e9%a1%b5%e9%9d%a2%e5%a4%9a%e5%bc%a0%e5%9b%be%e8%a1%a8/\" target=\"_blank\" >echarts学习笔记(2) -- 同一页面多图表</a></li>\n",
      "<li><a href=\"http://www.santostang.com/2017/03/08/hello-python/\" target=\"_blank\" >Hello Python!</a></li>  </ul>\n",
      "</aside>\n",
      "<aside class=\"widget clearfix\">\n",
      "  <h4 class=\"widget-title\">随机推荐</h4>\n",
      "  <ul class=\"widget-hot\">\n",
      "        <li><a href=\"http://www.santostang.com/2017/03/06/%e3%80%90%e7%88%ac%e8%99%ab%e4%b8%80%e3%80%91%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84%e7%88%ac%e8%99%ab%ef%bc%8c%e9%9b%b6%e5%9f%ba%e7%a1%80%e6%95%99%e5%ad%a6/\" title=\"【爬虫一】最简单的爬虫，零基础教学\">【爬虫一】最简单的爬虫，零基础教学</a></li>\n",
      "\t    <li><a href=\"http://www.santostang.com/2017/03/08/hello-python/\" title=\"Hello Python!\">Hello Python!</a></li>\n",
      "\t    <li><a href=\"http://www.santostang.com/2017/03/02/hello-world/\" title=\"Hello world!\">Hello world!</a></li>\n",
      "\t    <li><a href=\"http://www.santostang.com/2017/03/06/%e3%80%90%e7%88%ac%e8%99%ab%e4%ba%8c%e3%80%91%e7%88%ac%e8%99%ab%e7%9a%84%e6%a1%86%e6%9e%b6%e5%92%8c%e5%9f%ba%e6%9c%ac%e8%ae%ae%e9%a2%98/\" title=\"【爬虫二】爬虫的框架和基本议题\">【爬虫二】爬虫的框架和基本议题</a></li>\n",
      "\t    <li><a href=\"http://www.santostang.com/2017/03/07/echarts%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b01-%e4%bd%bf%e7%94%a8%e6%a8%a1%e5%9d%97%e5%8c%96%e5%8d%95%e6%96%87%e4%bb%b6%e5%bc%95%e5%85%a5/\" title=\"echarts学习笔记(1) &#8212; 模块化单文件引入\">echarts学习笔记(1) &#8212; 模块化单文件引入</a></li>\n",
      "\t    <li><a href=\"http://www.santostang.com/2017/03/07/echarts%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b02-%e5%8d%95%e9%a1%b5%e9%9d%a2%e5%a4%9a%e5%bc%a0%e5%9b%be%e8%a1%a8/\" title=\"echarts学习笔记(2) &#8212; 同一页面多图表\">echarts学习笔记(2) &#8212; 同一页面多图表</a></li>\n",
      "\t  </ul>\n",
      "</aside>\n",
      "<aside class=\"widget clearfix\">\n",
      "  <h4 class=\"widget-title\">标签云</h4>\n",
      "  <div class=\"widget-tags\">\n",
      "    <a href='http://www.santostang.com/tag/echarts/' class='tag-link-11 tag-link-position-1' title='1个话题' style=\"color:#1142e6;font-size: 8pt;;\">Echarts</a>\n",
      "<a href='http://www.santostang.com/tag/python/' class='tag-link-6 tag-link-position-2' title='2个话题' style=\"color:#91817c;font-size: 16.4pt;;\">python</a>\n",
      "<a href='http://www.santostang.com/tag/%e5%a4%a7%e6%95%b0%e6%8d%ae/' class='tag-link-8 tag-link-position-3' title='3个话题' style=\"color:#3ec769;font-size: 22pt;;\">大数据</a>\n",
      "<a href='http://www.santostang.com/tag/%e6%95%b0%e6%8d%ae%e5%8f%af%e8%a7%86%e5%8c%96/' class='tag-link-10 tag-link-position-4' title='1个话题' style=\"color:#712090;font-size: 8pt;;\">数据可视化</a>\n",
      "<a href='http://www.santostang.com/tag/%e7%bd%91%e7%bb%9c%e7%88%ac%e8%99%ab/' class='tag-link-7 tag-link-position-5' title='2个话题' style=\"color:#64df7b;font-size: 16.4pt;;\">网络爬虫</a>  </div>\n",
      "</aside>\n",
      "<aside class=\"widget clearfix\">\n",
      "  <h4 class=\"widget-title\">友情链接</h4>\n",
      "  <ul class=\"widget-links\">\n",
      "    <li><a href=\"http://www.santostang.com/wp-login.php\">登录</a></li>\n",
      "  </ul>\n",
      "</aside>\n",
      "    </div>\n",
      "  </div>\n",
      "</div>\n",
      "\n",
      "<footer id=\"footer\">\n",
      "  <div class=\"copyright\">\n",
      "    <p><i class=\"fa fa-copyright\" aria-hidden=\"true\"></i> 2017 <b>大数据@唐松Santos</b></p>\n",
      "    <p>Powered by <b>WordPress</b>. Theme by <a href=\"http://tangjie.me/jiestyle\" title=\"JieStyle\" target=\"_blank\"><b>JieStyle Two</b></a> | </p>\n",
      "  </div>\n",
      "  <div style=\"display:none;\">  </div>\n",
      "</footer>\n",
      "<script type=\"text/javascript\" src=\"http://www.santostang.com/wp-content/themes/SongStyle-Two/js/skel.min.js\"></script> \n",
      "<script type=\"text/javascript\" src=\"http://www.santostang.com/wp-content/themes/SongStyle-Two/js/util.min.js\"></script> \n",
      "<script type=\"text/javascript\" src=\"http://www.santostang.com/wp-content/themes/SongStyle-Two/js/nav.js\"></script>\n",
      "<script type='text/javascript' src='http://www.santostang.com/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>\n",
      "<script type='text/javascript' src='http://www.santostang.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1'></script>\n",
      "<script type='text/javascript'>\n",
      "/* <![CDATA[ */\n",
      "var CrayonSyntaxSettings = {\"version\":\"_2.7.2_beta\",\"is_admin\":\"0\",\"ajaxurl\":\"http:\\/\\/www.santostang.com\\/wp-admin\\/admin-ajax.php\",\"prefix\":\"crayon-\",\"setting\":\"crayon-setting\",\"selected\":\"crayon-setting-selected\",\"changed\":\"crayon-setting-changed\",\"special\":\"crayon-setting-special\",\"orig_value\":\"data-orig-value\",\"debug\":\"\"};\n",
      "var CrayonSyntaxStrings = {\"copy\":\"\\u4f7f\\u7528 %s \\u590d\\u5236\\uff0c\\u4f7f\\u7528 %s \\u7c98\\u8d34\\u3002\",\"minimize\":\"\\u70b9\\u51fb\\u5c55\\u5f00\\u4ee3\\u7801\"};\n",
      "/* ]]> */\n",
      "</script>\n",
      "<script type='text/javascript' src='http://www.santostang.com/wp-content/plugins/crayon-syntax-highlighter/js/min/crayon.min.js?ver=_2.7.2_beta'></script>\n",
      "<script type='text/javascript' src='http://www.santostang.com/wp-includes/js/wp-embed.min.js?ver=4.7.5'></script>\n",
      "<script>\n",
      "(function(){\n",
      "    var bp = document.createElement('script');\n",
      "    var curProtocol = window.location.protocol.split(':')[0];\n",
      "    if (curProtocol === 'https') {\n",
      "        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        \n",
      "    }\n",
      "    else {\n",
      "        bp.src = 'http://push.zhanzhang.baidu.com/push.js';\n",
      "    }\n",
      "    var s = document.getElementsByTagName(\"script\")[0];\n",
      "    s.parentNode.insertBefore(bp, s);\n",
      "})();\n",
      "</script>\n",
      "</body>\n",
      "</html>\n"
     ]
    }
   ],
   "source": [
    "#!/usr/bin/python\n",
    "# coding: utf-8\n",
    "\n",
    "import requests\n",
    "link = \"http://www.santostang.com/\"\n",
    "headers = {'User-Agent' : 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'} \n",
    "\n",
    "r = requests.get(link, headers= headers)\n",
    "print (r.text)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.3.2 第二步：提取需要的数据\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello Python!\n"
     ]
    }
   ],
   "source": [
    "#!/usr/bin/python\n",
    "# coding: utf-8\n",
    "\n",
    "import requests\n",
    "from bs4 import BeautifulSoup     #从bs4这个库中导入BeautifulSoup\n",
    "\n",
    "link = \"http://www.santostang.com/\"\n",
    "headers = {'User-Agent' : 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'} \n",
    "r = requests.get(link, headers= headers)\n",
    "\n",
    "soup = BeautifulSoup(r.text, \"html.parser\")      #使用BeautifulSoup解析这段代码\n",
    "title = soup.find(\"h1\", class_=\"post-title\").a.text.strip()\n",
    "print (title)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.3.3 第三步：储存数据\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello Python!\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "from bs4 import BeautifulSoup   #从bs4这个库中导入BeautifulSoup\n",
    "\n",
    "link = \"http://www.santostang.com/\"\n",
    "headers = {'User-Agent' : 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'} \n",
    "r = requests.get(link, headers= headers)\n",
    "\n",
    "soup = BeautifulSoup(r.text, \"html.parser\")   #使用BeautifulSoup解析这段代码\n",
    "title = soup.find(\"h1\", class_=\"post-title\").a.text.strip()\n",
    "print (title)\n",
    "\n",
    "with open('title_test.txt', \"a+\") as f:\n",
    "    f.write(title)\n",
    "    f.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  },
  "toc": {
   "colors": {
    "hover_highlight": "#DAA520",
    "navigate_num": "#000000",
    "navigate_text": "#333333",
    "running_highlight": "#FF0000",
    "selected_highlight": "#FFD700",
    "sidebar_border": "#EEEEEE",
    "wrapper_background": "#FFFFFF"
   },
   "moveMenuLeft": true,
   "nav_menu": {
    "height": "192px",
    "width": "252px"
   },
   "navigate_menu": true,
   "number_sections": true,
   "sideBar": true,
   "threshold": 4,
   "toc_cell": false,
   "toc_section_display": "block",
   "toc_window_display": false,
   "widenNotebook": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
